package com.villaday.idf.adapter2;

import android.content.Context;
import android.view.View;

import com.villaday.idf.R;
import com.villaday.idf.base.AbsRecyclerViewAdapter;
import com.villaday.idf.base.OnAdapterCallbackListener;
import com.villaday.idf.model.RefreshtokenEntity;
import com.villaday.idf.model2.Business_districts;
import com.villaday.idf.util.SharedPreferencesUtil;

/**
 * 民宿
 */

public class FindMinSulChooseAddr2Adapter<T> extends AbsRecyclerViewAdapter<Business_districts.BodyEntity.ChildrenEntity> {
    private OnAdapterCallbackListener onAdapterCallbackListener;
    private View.OnClickListener onClickListener;
    private final String roleType;
    private boolean isHaveThird;


    public FindMinSulChooseAddr2Adapter(Context context,/*, OnAdapterCallbackListener onAdapterCallbackListener, View.OnClickListener onClickListener*/boolean isHaveThird) {
        super(context, R.layout.item_find_minsu_addr2,R.layout.item_find_minsu_addr22, R.layout.item_page_loading,
                R.layout.item_page_bottom);
        this.isHaveThird = isHaveThird;
        this.onAdapterCallbackListener = onAdapterCallbackListener;
        this.onClickListener = onClickListener;
        RefreshtokenEntity.BodyBean roleInfo =
                SharedPreferencesUtil.getRoleInfo(context);
        roleType = roleInfo.getMember().getType();

    }

    @Override
    public int getItemType(Business_districts.BodyEntity.ChildrenEntity d) {
        return isHaveThird?0:1;
    }

    @Override
    public void onBindHolder(AbsRecyclerViewAdapter.RecyclerViewHolder holder, Business_districts.BodyEntity.ChildrenEntity d, int position) {

        holder.bindTextView(R.id.tv_name, d.getName())
                .setViewSelected(R.id.tv_name, d.isSelect());


    }
}
